<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
</head>
<body>
<!--
    制作者：九哥
    页面：企业面试详情页面
    时间：2019-09-29
-->





<!----------企业面试详情页面---------->
<div id="jobShowPage"><!--此ID页面切换用-->
    <div id="jobShowTitle">
        <b>企业面试详情</b>
        <img src="../../images/return.png" id="jobShowRtn"
             onclick="history.go(-1);">
    </div>
    <div id="jobShowDetail">
        <table>
            <tr>
                <td width="60">
                    <span id="head"></span>
                </td>
                <td>
                    <p>联系人：
                        <span id="contact"></span>
                    </p>
                    <p>招聘电话：
                        <span id="telephone"></span>
                    </p>
                    <p>招聘工种：
                        <span id="jobName"></span>
                    </p>
                    <p>招聘性别：
                        <span id="sexName"></span>
                    </p>
                </td>
            </tr>
        </table>
        <div style="height:10px;background:#f8f8f8;"></div>
        <div class="detail">
            <p>
                公司名称：
                <span id="cname"></span>
            </p>
            <!--<p style="border-bottom:1px solid #f8f8f8;">-->
                <!--<img src="../../images/locate.png" width="8">-->
                <!--所在地区-->
                <!--<span style="float:right;" id="address"></span>-->
            <!--</p>-->
            <p style="border-bottom:1px solid #f8f8f8;">
                <img src="../../images/locate.png" width="8">
                所在地区：
                <span id="address"></span>
            </p>
            <p>
                需要人数：
                <span id="num"></span>
                <br><br>
                薪资：
                <span id="emolument"></span>
                <br><br>
                招聘待遇：
                <span id="welfare"></span>
                <br><br>
                学历要求：
                <span id="eduName"></span>
                <br><br>
                工作年限：
                <span id="workYear"></span>
                <br><br>
                工作时间：
                <span id="workHour"></span>
                <br><br>
                邮箱地址：
                <span id="email"></span>
                <br><br>
                年龄区间：
                <span id="ageRange"></span>
            </p>
            <b>岗位介绍</b>
            <p>
                <span id="detail"></span>
            </p>
            <b>需要技能</b>
            <p>
                <span id="skill"></span>
            </p>
            <b>岗位内容</b>
            <p>
                <span id="content"></span>
            </p>
            <!--企业操作按钮-->
            <!--1发布中，2投递中，3投递拒绝，4面试邀请，5拒绝邀请，-->
            <!--6面试失败，7面试成功，8企业评价，9工人评价，10完成-->
            <p class="submit">
                招聘流程状态：【<span id="statusName"></span>】
                <br><br>
                <button onclick="getTalk()">去交流</button>
                &nbsp; &nbsp;
                <span id="meet"></span>
                <!--<button onclick="setMeetFinish()">完成面试</button>-->
                <br><br>
                <span id="comment"></span>
                <!--<button onclick="getCommit()">去评价</button>-->
                &nbsp; &nbsp;
                <span id="finish"></span>
            </p>
            <br><br><br>
        </div>
    </div>
</div>
<input type="hidden" id="cid" value="0">
<!----------企业面试页面---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript" src="../../js/cache.js"></script>
</html>


<script type="text/javascript">
    (function(){
//        getUserType();
        getShowList();
    })();
//    //判断工人/企业
//    function getUserType(){
//        var userInfo = cacheGet('userInfo');
//        if (!userInfo.type) {
//            getAppErrMsg('没有登陆！','',0);
//            return
//        }
//        if (userInfo.type!=1) {
//            $('.submit').hide();
//        }
//    }
    //岗位列表
    function getShowList(){
        var userInfo = cacheGet('userInfo');
        var id = getUrlParam('staffJobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            id:id
        };
        $.ajax({
            type:'post',
            url:getDomain()+'/show',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',2);
                    console.log(res);
                    return
                }
                console.log(res.data);
                var resData = res.data;
                var head = '<img src="../../images/toux01.png" width="40">';
                if (resData.head!='') {
                    head = '<img src="'+resData.head+'" width="40">';
                }
                $('#cid')[0].value = resData.cid;
                $('#cname').html(resData.cname);
                $('#contact').html(resData.contact);
                $('#head').html(head);
                $('#jobName').html(resData.jobName);
                $('#sexName').html(resData.sexName);
                $('#telephone').html(resData.telephone);
                $('#address').html(resData.address);
                $('#emolument').html(resData.emolument);
                $('#welfare').html(resData.welfare);
                $('#num').html(resData.num);
                $('#workYear').html(resData.workYear);
                $('#workHour').html(resData.workHour);
                $('#ageRange').html(resData.ageRange);
                $('#email').html(resData.email);
                $('#eduName').html(resData.eduName);
                if (resData.detail) {
                    $('#detail').html(resData.detail);
                } else {
                    $('#detail').html('没有');
                }
                if (resData.skill) {
                    $('#skill').html(resData.skill);
                } else {
                    $('#skill').html('没有');
                }
                if (resData.content) {
                    $('#content').html(resData.content);
                } else {
                    $('#content').html('没有');
                }
            }
        });
    }
    //去交流，工人可看
    function getTalk(){
        var cid = $('#cid').val();
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('jobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            cid:cid,
            job:jobId
        };
        $.ajax({
            type:'post',
            url:'/api/msg/add',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',2);
                    console.log(res);
                    return
                }
                var resData = res.data;
//                console.log(resData);
                var talkId = resData.talkId;
                var own = resData.own;
                var other = resData.other;
                var otherName = resData.otherName;
                var jobId = resData.jobId;
                var prefix = '?id='+talkId+'&own='+own+'&other='+other+'&otherName='+otherName+'&jobId='+jobId;
                window.location.href = '/h5/message/jobWin.html'+prefix;
            }
        });
    }
    //去邀约，企业邀请面试
    function getMeet(){
        var cid = $('#cid').val();
        var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('jobId');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            cid:cid,
            job:jobId
        };
        $.ajax({
            type:'post',
            url:'/api/home/recruit/resume-add',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code==-41) {
                    console.log(res);
                    getAppErrMsg('您的简历早已发送！','',0);
                    return
                } else if (res.code!=0) {
                    console.log(res);
                    getAppErrMsg(res.msg,'',0);
                    return
                }
                var resData = res.data;
                getAppErrMsg('发送成功！','',0);
            }
        });
    }
    //设置面试完成
    function setMeetFinish(){
        getAppErrMsg('待接入！','',0)
    }
    //去评价
    function getComment(){
        getAppErrMsg('待接入！','',0)
    }
    //请求地址
    function getDomain(){
        return '/api/my/job/staff';
    }
</script>